const role = require("../controllers/role");
const admin = require("../controllers/admin");
const { checkRole } = require("../middleware/role")
const { checkTokenAdmin } = require("../middleware/jwt")
module.exports = app => {
    // 测试路由
    app.get("/", role.getMenu)
    app.get("/test", (req, res, next) => checkRole(req, res, next, 'test'), role.test);

    // 后台注册
    app.post("/register", admin.register)
    // // 后台登录
    app.post("/admin/login", admin.login)
    app.get("/admin/init", checkTokenAdmin, admin.init)

}